import java.util.Scanner;

public class Xuesheng {
    String name;
    String laoshi;
    String[] stu = new String[30];

    public void add(String stuname) {
        for (int i = 0; i < stu.length; i++) {
            if (stu[i] == null) {
                stu[i] = stuname;
                return;
            }
        }
        System.out.println("班级已满");
    }

    public void show() {
        for (int i = 0; i < stu.length; i++) {
            if (stu[i] == null) {
                System.out.println();
                return;
            }
            System.out.print(stu[i] + "  ");
        }
    }

    public boolean xingmixuanze(String name) {
        for (int i = 0; i < stu.length; i++) {
            if (stu[i] == null)
                return false;
            if (stu[i].equals(name))
                return true;
        }
        return false;
    }

    public boolean xuanze(int start, int end, String name) {
        for (int i = 0; i < stu.length; i++) {
            if (stu[i] == null)
                return false;
            if (stu[i].equals(name))
                return true;
        }
        return false;
    }

    public String find(int index) {
        if (stu[index - 1] == null)
            return "位置为空";
        return stu[index - 1];
    }

    int i;

    public boolean newName(String name) {
        i = 0;
        for (; i < stu.length; i++) {
            if (stu[i] == null)
                return false;
            if (stu[i].equals(name)) {
                return true;
            }

        }
        return false;
    }

    public void getName(String getName) {
        if (getName.equals(stu[i]) ) {
            System.out.println("用户名与上一次相同");
        }else {
            stu[i] = getName;
            System.out.println("新用户名："+stu[i]);
        }
    }
}

